home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SBC Yahoo! Dial - Start Y… NeW Internet Experience
/
SBC Yahoo! Dial - Start.iso
/
pc
/
Reg
/
regcommon.js
< prev
next >
Wrap
Text File
|
2002-05-02
|
19KB
|
659 lines
var storedfocus = "";
var btnClicked = false;
var regServer = "isp.member.yahoo.com";
var popsurl = "http://" + regServer + "/regisp/y/pops?post&linforeplace&.client=yreghost&.clientversion=2&.partner=sbc&.region=dial&areaCode=linfodialareacode&exchange=linfodialexchange&saveHTML=linfopreloadfilename0&.clientPath=linfohtmlpath&.imagePath=linfoclientimagepath&.regid=linforegistrationid&.sessionId=linfouservariableregSession&cstatus=linforeportinfo";
var regurl = "http://" + regServer + "/regisp/y/start?post&linforeplace&.client=yreghost&.clientversion=2&.partner=sbc&.region=dial&.clientPath=linfohtmlpath&.imagePath=linfoclientimagepath&.regid=linforegistrationid®Pop1=selectedNumber1®Pop2=selectedNumber2®Pop3=selectedNumber3®Pop4=selectedNumber4®Pop5=selectedNumber5®City1=selectedCity1&.sessionId=linfouservariableregSession&cstatus=linforeportinfo";
var cancelMessage = "SBC Yahoo! Dial Setup is not complete. Are you sure you want to cancel?";
var cancelTitle = "Setup Is Not Complete";
var popupDisplayed = false;
if (document.images) {
BtnNexton = new Image(); BtnNexton.src = "images/sbc/buttons/next_over.gif";
BtnNextoff = new Image(); BtnNextoff.src = "images/sbc/buttons/next_out.gif";
BtnNextdown = new Image(); BtnNextdown.src = "images/sbc/buttons/next_down.gif";
BtnCancelon = new Image(); BtnCancelon.src = "images/sbc/buttons/cancel_over.gif";
BtnCanceloff = new Image(); BtnCanceloff.src = "images/sbc/buttons/cancel_out.gif";
BtnCanceldown = new Image(); BtnCanceldown.src = "images/sbc/buttons/cancel_down.gif";
BtnBackon = new Image(); BtnBackon.src = "images/sbc/buttons/back_over.gif";
BtnBackoff = new Image(); BtnBackoff.src = "images/sbc/buttons/back_out.gif";
BtnBackdown = new Image(); BtnBackdown.src = "images/sbc/buttons/back_down.gif";
BtnHelpon = new Image(); BtnHelpon.src = "images/sbc/buttons/help_over.gif";
BtnHelpoff = new Image(); BtnHelpoff.src = "images/sbc/buttons/help_out.gif";
BtnHelpdown = new Image(); BtnHelpdown.src = "images/sbc/buttons/help_down.gif";
BtnCheckunchecked = new Image(); BtnCheckunchecked.src = "images/sbc/checkbox_out_unchecked.gif";
BtnCheckchecked = new Image(); BtnCheckchecked.src = "images/sbc/checkbox_out_checked.gif";
BtnCheckdown = new Image(); BtnCheckdown.src = "images/sbc/checkbox_down_checked.gif";
BtnCheckup = new Image(); BtnCheckup.src = "images/sbc/checkbox_out_unchecked.gif";
BtnRadiounchecked = new Image(); BtnRadiounchecked.src = "images/sbc/radio_out_unchecked.gif";
BtnRadiochecked = new Image(); BtnRadiochecked.src = "images/sbc/radio_checked.gif";
BtnCancelYeson = new Image(); BtnCancelYeson.src = "images/sbc/buttons/yes_over.gif";
BtnCancelYesoff = new Image(); BtnCancelYesoff.src = "images/sbc/buttons/yes_out.gif";
BtnCancelYesdown = new Image(); BtnCancelYesdown.src = "images/sbc/buttons/yes_down.gif";
BtnCancelNoon = new Image(); BtnCancelNoon.src = "images/sbc/buttons/no_over.gif";
BtnCancelNooff = new Image(); BtnCancelNooff.src = "images/sbc/buttons/no_out.gif";
BtnCancelNodown = new Image(); BtnCancelNodown.src = "images/sbc/buttons/no_down.gif";
BtnAlertOKon = new Image(); BtnAlertOKon.src = "images/sbc/buttons/ok_over.gif";
BtnAlertOKoff = new Image(); BtnAlertOKoff.src = "images/sbc/buttons/ok_out.gif";
BtnAlertOKdown = new Image(); BtnAlertOKdown.src = "images/sbc/buttons/ok_down.gif";
BtnNRetryon = new Image(); BtnNRetryon.src = "images/sbc/buttons/nretry_over.gif";
BtnNRetryoff = new Image(); BtnNRetryoff.src = "images/sbc/buttons/nretry_out.gif";
BtnNRetrydown = new Image(); BtnNRetrydown.src = "images/sbc/buttons/nretry_down.gif";
BtnRedialon = new Image(); BtnRedialon.src = "images/sbc/buttons/redial_over.gif";
BtnRedialoff = new Image(); BtnRedialoff.src = "images/sbc/buttons/redial_out.gif";
BtnRedialdown = new Image(); BtnRedialdown.src = "images/sbc/buttons/redial_down.gif";
}
function isButton(obj)
{
return obj && (obj.name == "BtnNext" || obj.name == "BtnFinish" || obj.name == "BtnCancel" || obj.name == "BtnBack" || obj.name == "BtnPrint" || obj.name == "BtnHelp" || obj.name == "BtnRetry" || obj.name == "BtnCheck" || obj.name == "BtnRadio" || obj.name == "BtnAlertOK" || obj.name == "BtnCancelNo"|| obj.name == "BtnCancelYes"|| obj.name == "BtnRedial"|| obj.name == "BtnNRetry");
}
function focusOn() {
if(isButton(window.event.srcElement))
{
if(btnClicked == false)
{
storedfocus = window.event.srcElement.name;
window.event.srcElement.style.cursor = "hand";
window.event.srcElement.src = eval(window.event.srcElement.name + "on.src");
}
else
{
storedfocus = window.event.srcElement.name;
window.event.srcElement.style.cursor = "auto";
window.event.srcElement.src = eval(window.event.srcElement.name + "down.src");
}
}
}
function focusOff() {
storedfocus = "";
btnClicked = false;
turnOff();
}
function turnOn() {
if (document.images && isButton(window.event.srcElement))
{
if(storedfocus == ""|| storedfocus == window.event.srcElement.name)
{
window.event.srcElement.style.cursor = "hand";
window.event.srcElement.src = eval(window.event.srcElement.name + "on.src");
}
else
{
window.event.srcElement.style.cursor = "hand";
window.event.srcElement.src = eval(window.event.srcElement.name + "on.src");
document.all[storedfocus].src = eval(storedfocus + "off.src");
}
}
}
function turnOff() {
if (document.images && isButton(window.event.srcElement))
{
if (storedfocus == "")
{
window.event.srcElement.style.cursor = "auto";
window.event.srcElement.src = eval(window.event.srcElement.name + "off.src");
}
else
{
window.event.srcElement.style.cursor = "auto";
window.event.srcElement.src = eval(window.event.srcElement.name + "off.src");
document.all[storedfocus].src = eval(storedfocus + "on.src");
}
}
}
function turnDown() {
if (document.images && isButton(window.event.srcElement))
{
btnClicked = true;
window.event.srcElement.style.cursor = "auto";
window.event.srcElement.src = eval(window.event.srcElement.name + "down.src");
}
}
function FixMouse()
{
var i;
var x = document.images.length;
for (i = 0; i < x; i++)
{
if (document.images(i).name != "")
{
var base2 = document.images(i).name.substr(0,3);
var base3 = document.images(i).name.substr(0,8);
if ( base2 == "Btn" && base3 != "BtnRadio" && base3 != "BtnCheck")
if (document.images(i).src == eval (document.images(i).name + "down.src"))
{
if(document.images(i).name == storedfocus)
document.images(i).src = eval (document.images(i).name + "on.src");
else
document.images(i).src = eval (document.images(i).name + "off.src");
}
//else if(document.images(i).src == eval (document.images(i).name + "on.src") && document.images(i).name == storedfocus)
//document.images(i).src = eval (document.images(i).name + "off.src");
}
}
}
/*function onCancel(){
document.forms[0].action = "http://localaction.bogus.yahoo.moc/actionCancel?";
document.forms[0].submit();
return;
}*/
function onStopDrag()
{
window.event.returnValue = false;
window.event.cancelBubble = true;
window.event.dataTransfer.dropEffect = "none";
window.event.dataTransfer.effectAllowed = "none";
return false;
}
function DocumentOnKeyPressX()
{
var namecheck = window.event.srcElement.name;
var base2 ="";
if( event.keyCode == 32)
{
if (namecheck)
base2 = namecheck.substr( 0, 3 );
if( window.event.srcElement.type == "text" || base2 == "Btn")
{
}
else
window.event.returnValue = false;
}
return;
}
function DocumentOnKeyPress()
{
if( event.keyCode == 32)
{
if (storedfocus == "BtnNext")
{
onNext();
window.event.returnValue = false;
}
else if (storedfocus == "BtnFinish")
{
onFinish();
window.event.returnValue = false;
}
else if (storedfocus == "BtnBack")
{
onBack();
window.event.returnValue = false;
}
else if(storedfocus == "BtnRetry")
{
onRetry();
window.event.returnValue = false;
}
else if (storedfocus == "BtnCancel")
{
onCancel();
window.event.returnValue = false;
}
else if (storedfocus == "BtnPrint")
{
onPrint();
window.event.returnValue = false;
}
else if (storedfocus == "BtnHelp")
{
onHelp();
window.event.returnValue = false;
}
else if (storedfocus == "BtnNRetry")
{
onNext();
window.event.returnValue = false;
}
else if (storedfocus == "BtnRedial")
{
onNext();
window.event.returnValue = false;
}
else if (storedfocus == "BtnAlertOK")
{
onAlertClose();
window.event.returnValue = false;
}
else if (storedfocus == "BtnCancelYes")
{
onCancelYes();
window.event.returnValue = false;
}
else if (storedfocus == "BtnCancelNo")
{
onCancelNo();
window.event.returnValue = false;
}
}
}
function DocumentOnKeyUp()
{
if( event.keyCode == 13)
{
if (storedfocus == "BtnNext")
{
onNext();
window.event.returnValue = false;
return;
}
else if (storedfocus == "BtnFinish")
{
onFinish();
window.event.returnValue = false;
return;
}
else if (storedfocus == "BtnBack")
{
onBack();
window.event.returnValue = false;
return;
}
else if(storedfocus == "BtnRetry")
{
onRetry();
window.event.returnValue = false;
return;
}
else if(storedfocus == "BtnNRetry")
{
onNext();
window.event.returnValue = false;
return;
}
else if(storedfocus == "BtnRedial")
{
onNext();
window.event.returnValue = false;
return;
}
else if (storedfocus == "BtnCancel")
{
onCancel();
window.event.returnValue = false;
return;
}
else if (storedfocus == "BtnHelp")
{
onHelp();
window.event.returnValue = false;
return;
}
else if (storedfocus == "BtnAlertOK")
{
onAlertClose();
window.event.returnValue = false;
return;
}
else if (storedfocus == "BtnCancelYes")
{
onCancelYes();
window.event.returnValue = false;
return;
}
else if (storedfocus == "BtnCancelNo")
{
onCancelNo();
window.event.returnValue = false;
return;
}
else if( document.all("BtnAlertOK") != null && (document.all("scAlert").style.display == "inline"))
{
onAlertClose();
return;
}
else if( document.all("BtnCancelYes") != null && (document.all("scCancel").style.display == "inline"))
{
onCancelYes();
return;
}
else if( document.all("BtnNext") != null )
{
onNext();
return;
}
else if (document.all("BtnFinish") != null )
{
onFinish();
return;
}
}
else if( event.keyCode == 27)
{
if( document.all("BtnAlertOK") != null && (document.all("scAlert").style.display == "inline"))
{
onAlertClose();
return;
}
else if( document.all("BtnCancelNo") != null && (document.all("scCancel").style.display == "inline"))
{
onCancelNo();
return;
}
else if( document.all("BtnCancel") != null )
{
onCancel();
return;
}
}
else if(event.keyCode == 112)
{
onHelp();
return;
}
try
{
if (event.altKey == true)
{
var hot = String.fromCharCode(event.keyCode);
if (hot == "N")
{
if( document.all("BtnNext") != null && popupDisplayed == false)
onNext();
else if( document.all("BtnFinish") != null && popupDisplayed == false)
onFinish();
}
else if (hot == "B" && document.all("BtnBack") != null && popupDisplayed == false)
onBack();
else if(hot == "R" && document.images.BtnRetry && popupDisplayed == false)
onRetry();
else if(hot == "R" && document.images.BtnNRetry && popupDisplayed == false)
onNext();
else if(hot == "R" && document.images.BtnRedial && popupDisplayed == false)
onNext();
}
}
catch( exception )
{
return;
}
}
document.onkeyup = DocumentOnKeyUp;
document.onkeypress = DocumentOnKeyPressX;
document.ondragstart = onStopDrag;
document.onmouseup = FixMouse;
function IsAlpha( nCharCode )
{
if ( nCharCode >= 65 && nCharCode <= 122 )
return true;
return false;
}
function IsAlphaNumeric( nCharCode )
{
if ( nCharCode >= 65 && nCharCode <= 122 )
return true;
if ( nCharCode >= 48 && nCharCode <= 57 )
return true;
return false;
}
function NumValuesKeyPress()
{
switch( event.keyCode )
{
case 45:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
break;
default:
event.returnValue = false;
break;
}
}
// Code added by Mike Lee
function checkDown(){
if(isButton(window.event.srcElement))
{
if(window.event.srcElement.src==eval(window.event.srcElement.name+"checked.src"))
{
window.event.srcElement.style.cursor="auto";
window.event.srcElement.src=eval(window.event.srcElement.name+"down.src");
}
else
{
window.event.srcElement.style.cursor="auto";
window.event.srcElement.src=eval(window.event.srcElement.name+"up.src");
}
}
return;
}
function onCheckboxCheck(s)
{
// if(isButton(window.event.srcElement))
{
if((window.event.srcElement.src==eval(window.event.srcElement.name+"down.src"))||
(window.event.srcElement.src==eval(window.event.srcElement.name+"checked.src")))
{
window.event.srcElement.src=eval(window.event.srcElement.name+"unchecked.src");
window.event.srcElement.alt="Checkbox unchecked";
UpdateVariables(s,"off");
}
else
{
window.event.srcElement.src=eval(window.event.srcElement.name+"checked.src");
window.event.srcElement.alt="Checkbox checked";
UpdateVariables(s,"on");
}
}
return;
}
//-->
function ButtonInit()
{
if( document.all("BtnHelp") != null )
{
document.all("BtnHelp").onmouseout = turnOff;
document.all("BtnHelp").onmouseover = turnOn;
document.all("BtnHelp").onmousedown = turnDown;
document.all("BtnHelp").onfocus = focusOn;
document.all("BtnHelp").onblur = focusOff;
document.all("BtnHelp").onkeypress = DocumentOnKeyPress;
document.all("BtnHelp").onclick = onHelp;
}
if( document.all("BtnNext") != null )
{
document.all("BtnNext").onmouseout = turnOff;
document.all("BtnNext").onmouseover = turnOn;
document.all("BtnNext").onmousedown = turnDown;
document.all("BtnNext").onfocus = focusOn;
document.all("BtnNext").onblur = focusOff;
document.all("BtnNext").onkeypress = DocumentOnKeyPress;
document.all("BtnNext").onclick = onNext;
}
if( document.all("BtnBack") != null )
{
document.all("BtnBack").onmouseout = turnOff;
document.all("BtnBack").onmouseover = turnOn;
document.all("BtnBack").onmousedown = turnDown;
document.all("BtnBack").onfocus = focusOn;
document.all("BtnBack").onblur = focusOff;
document.all("BtnBack").onkeypress = DocumentOnKeyPress;
document.all("BtnBack").onclick = onBack;
}
if( document.all("BtnCancel") != null )
{
document.all("BtnCancel").onmouseout = turnOff;
document.all("BtnCancel").onmouseover = turnOn;
document.all("BtnCancel").onmousedown = turnDown;
document.all("BtnCancel").onfocus = focusOn;
document.all("BtnCancel").onblur = focusOff;
document.all("BtnCancel").onkeypress = DocumentOnKeyPress;
document.all("BtnCancel").onclick = onCancel;
}
if( document.all("BtnNRetry") != null )
{
document.all("BtnNRetry").onmouseout = turnOff;
document.all("BtnNRetry").onmouseover = turnOn;
document.all("BtnNRetry").onmousedown = turnDown;
document.all("BtnNRetry").onfocus = focusOn;
document.all("BtnNRetry").onblur = focusOff;
document.all("BtnNRetry").onkeypress = DocumentOnKeyPress;
document.all("BtnNRetry").onclick = onNext;
}
if( document.all("BtnRedial") != null )
{
document.all("BtnRedial").onmouseout = turnOff;
document.all("BtnRedial").onmouseover = turnOn;
document.all("BtnRedial").onmousedown = turnDown;
document.all("BtnRedial").onfocus = focusOn;
document.all("BtnRedial").onblur = focusOff;
document.all("BtnRedial").onkeypress = DocumentOnKeyPress;
document.all("BtnRedial").onclick = onNext;
}
}
function onLoad2Alert()
{
document.all("BtnAlertOK").onmouseout = turnOff;
document.all("BtnAlertOK").onmouseover = turnOn;
document.all("BtnAlertOK").onmousedown = turnDown;
document.all("BtnAlertOK").onfocus = focusOn;
document.all("BtnAlertOK").onblur = focusOff;
document.all("BtnAlertOK").onkeypress = DocumentOnKeyPress;
}
function onAlertClose()
{
document.all("scInstructions").style.display = "inline";
document.all("buttons").style.display = "inline";
document.all("scBody").style.display = "inline";
document.all("scAlert").style.display = "none";
popupDisplayed = false;
myfocus();
}
function onAlertDisplay( vTitle, vMsg )
{
document.all("scAlert").style.display = "inline";
document.all("scBody").style.display = "none";
document.all("scInstructions").style.display = "none";
document.all("buttons").style.display = "none";
popupDisplayed = true;
document.all("BtnAlertOK").onmouseout = turnOff;
document.all("BtnAlertOK").onmouseover = turnOn;
document.all("BtnAlertOK").onmousedown = turnDown;
document.all("BtnAlertOK").onfocus = focusOn;
document.all("BtnAlertOK").onblur = focusOff;
document.all("BtnAlertOK").onkeypress = DocumentOnKeyPress;
document.all("scTabTitleAlert").innerText = vTitle;
document.all("scAlertMessage").innerHTML = vMsg;
}
function onCancel()
{
document.all("scCancel").style.display = "inline";
document.all("scBody").style.display = "none";
document.all("scInstructions").style.display = "none";
document.all("buttons").style.display = "none";
popupDisplayed = true;
document.all("BtnCancelYes").onmouseout = document.all("BtnCancelNo").onmouseout = turnOff;
document.all("BtnCancelYes").onmouseover = document.all("BtnCancelNo").onmouseover = turnOn;
document.all("BtnCancelYes").onmousedown = document.all("BtnCancelNo").onmousedown = turnDown;
document.all("BtnCancelYes").onfocus = document.all("BtnCancelNo").onfocus = focusOn;
document.all("BtnCancelYes").onblur = document.all("BtnCancelNo").onblur = focusOff;
document.all("BtnCancelYes").onkeypress = document.all("BtnCancelNo").onkeypress = DocumentOnKeyPress;
document.all("scTabTitleCancel").innerText = cancelTitle;
document.all("scCancelMessage").innerHTML = cancelMessage;
return;
}
function onCancelYes()
{
popupDisplayed = false;
window.navigate("http://localaction.bogus.yahoo.moc/actionDone?");
return true;
}
function onCancelNo()
{
document.all("scInstructions").style.display = "inline";
document.all("buttons").style.display = "inline";
document.all("scBody").style.display = "inline";
document.all("scCancel").style.display = "none";
popupDisplayed = false;
}
function myfocus()
{
if(focEl != "")
document.all(focEl).focus();
return;
}
function onHelpDisplay(helpUrl)
{
var nLeft = (window.screen.availWidth - 415 ) /2;
var nTop = (window.screen.availHeight - 315 ) /2;
var sFeatures = "height=315,width=415,left="+nLeft+",top="+ nTop;
sFeatures += "fullscreen=no,location=no,menubar=no,resizeable=no,status=no,titlebar=no,toolbar=no,directories=no";
sFeatures += ",scrollbars=no";
window.open ( helpUrl, "_blank", sFeatures );
return true;
}